{
  "name": "Case 4 – University Admissions Screening",
  "nodes": [
    {
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2,
      "position": [0, 0],
      "parameters": {
        "formTitle": "University Application Submission",
        "formDescription": "Upload SOP and transcripts for admissions screening",
        "formFields": {
          "values": [
            { "fieldLabel": "Applicant Name", "requiredField": true },
            { "fieldLabel": "Email id", "fieldType": "email", "requiredField": true },
            {
              "fieldLabel": "Student_Application",
              "fieldType": "file",
              "acceptFileTypes": ".pdf",
              "requiredField": true
            }
          ]
        }
      }
    },
    {
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [220, 0],
      "parameters": {
        "inputDataFieldName": "Student_Application",
        "name": "={{ $json['Applicant Name'] + '_Application' }}",
        "folderId": "REPLACE_WITH_ADMISSIONS_FOLDER_ID"
      }
    },
    {
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [420, 0],
      "parameters": {
        "operation": "download",
        "fileId": "={{ $json.id }}"
      }
    },
    {
      "name": "Extract Application",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [620, 0],
      "parameters": { "operation": "pdf" }
    },
    {
      "name": "Download Eligibility Rubric",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [820, 0],
      "parameters": {
        "operation": "download",
        "fileId": "REPLACE_WITH_ELIGIBILITY_RUBRIC_FILE_ID"
      }
    },
    {
      "name": "Extract Rubric",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [1020, 0],
      "parameters": { "operation": "pdf" }
    },
    {
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [220, 260],
      "parameters": {
        "promptType": "define",
        "text": "=Student Application:\n{{ $('Extract Application').item.json.text }}\n\nEligibility Rubric:\n{{ $('Extract Rubric').item.json.text }}",
        "options": {
          "systemMessage": "You are a University Admissions Analyst. Evaluate applicant strictly per rubric. Output ONLY valid JSON and call the Google Sheets Append Row tool."
        }
      }
    },
    {
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [0, 420],
      "parameters": {
        "model": { "mode": "list", "value": "gpt-4.1-mini" }
      }
    },
    {
      "name": "Append row",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4,
      "position": [420, 460],
      "parameters": {
        "operation": "append",
        "documentId": "REPLACE_WITH_GOOGLE_SHEET_ID",
        "sheetName": "University Admissions – Applicant Screening Register"
      }
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [420, 260],
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Email id'] }}",
        "subject": "University Application – Screening Outcome",
        "message": "={{ 'Dear ' + $('On form submission').item.json['Applicant Name'] + ',<br><br>Thank you for applying. Based on our initial screening, we will inform you shortly regarding the next steps in the admissions process.<br><br>Admissions Committee' }}"
      }
    }
  ],
  "connections": {
    "On form submission": { "main": [[{ "node": "Upload file" }]] },
    "Upload file": { "main": [[{ "node": "Download file" }]] },
    "Download file": { "main": [[{ "node": "Extract Application" }]] },
    "Extract Application": { "main": [[{ "node": "Download Eligibility Rubric" }]] },
    "Download Eligibility Rubric": { "main": [[{ "node": "Extract Rubric" }]] },
    "Extract Rubric": { "main": [[{ "node": "AI Agent" }]] },
    "OpenAI Chat Model": { "ai_languageModel": [[{ "node": "AI Agent" }]] },
    "Append row": { "ai_tool": [[{ "node": "AI Agent" }]] },
    "AI Agent": { "main": [[{ "node": "Send Email" }]] }
  },
  "active": false
}
